﻿Shader "Custom/HoleInBody Mobile"
{
	Properties
	{
	  _MainTex("Base (ARGB)", 2D) = "white" {}
	  _WidthMainTex("Main Width", float) = 0
	  _HeightMainTex("Main Height", float) = 0
	  [NoScaleOffset] _BloodTex("Blood (ARGB)", 2D) = "white" {}
	  _WidthBloodTex("Blood Width", float) = 1
	  _HeightBloodTex("Blood Height", float) = 1
	  [NoScaleOffset] _HoleTex("Hole (ARGB)", 2D) = "white" {}
	  _WidthHoleTex("Hole Width", float) = 1
	  _HeightHoleTex("Hole Height", float) = 1
	  PositionHole1("Position Hole1", Vector) = (0,0,0,1)
	  PositionHole2("Position Hole2", Vector) = (0,0,0,1)
	  PositionHole3("Position Hole3", Vector) = (0,0,0,1)
	  PositionHole4("Position Hole4", Vector) = (0,0,0,1)
	  PositionHole5("Position Hole5", Vector) = (0,0,0,1)
	  CurrentHole("CurrentHole", float) = 1
	}
		SubShader
	  {
		Tags
		{
		  "IGNOREPROJECTOR" = "true"
		  "QUEUE" = "Transparent"
		  "RenderType" = "Transparent"
		}
		LOD 100
		Pass // ind: 1, name: 
		{
		  Tags
		  {
			"IGNOREPROJECTOR" = "true"
			"QUEUE" = "Transparent"
			"RenderType" = "Transparent"
		  }
		  LOD 100
		  ZWrite Off
		  Cull Off
		  Blend SrcAlpha OneMinusSrcAlpha
		  // m_ProgramMask = 6
		  CGPROGRAM
		  //#pragma target 4.0

		  #pragma vertex vert
		  #pragma fragment frag

		  #include "UnityCG.cginc"


		  #define CODE_BLOCK_VERTEX
		  //uniform float4x4 unity_ObjectToWorld;
		  //uniform float4x4 unity_MatrixVP;
		  uniform float4 _MainTex_ST;
		  uniform float _WidthMainTex;
		  uniform float _HeightMainTex;
		  uniform float _WidthBloodTex;
		  uniform float _HeightBloodTex;
		  uniform float _WidthHoleTex;
		  uniform float _HeightHoleTex;
		  uniform float4 PositionHole1;
		  uniform float4 PositionHole2;
		  uniform float4 PositionHole3;
		  uniform float4 PositionHole4;
		  uniform float4 PositionHole5;
		  uniform sampler2D _MainTex;
		  uniform sampler2D _HoleTex;
		  uniform sampler2D _BloodTex;
		  struct appdata_t
		  {
			  float4 vertex :POSITION0;
			  float4 color :COLOR0;
			  float2 texcoord :TEXCOORD0;
		  };

		  struct OUT_Data_Vert
		  {
			  float4 color :COLOR0;
			  float2 texcoord :TEXCOORD0;
			  float4 vertex :SV_POSITION;
		  };

		  struct v2f
		  {
			  float4 color :COLOR0;
			  float2 texcoord :TEXCOORD0;
		  };

		  struct OUT_Data_Frag
		  {
			  float4 color :SV_Target0;
		  };

		  float4 u_xlat0;
		  float4 u_xlat1;
		  OUT_Data_Vert vert(appdata_t in_v)
		  {
			  OUT_Data_Vert out_v;
			  u_xlat0 = UnityObjectToClipPos(in_v.vertex);
			  out_v.vertex = u_xlat0;
			  out_v.color = in_v.color;
			  u_xlat0.xy = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
			  out_v.texcoord.xy = u_xlat0.xy;
			  return out_v;
		  }

		  #define CODE_BLOCK_FRAGMENT
		  float u_xlat16_0;
		  float2 u_xlat1_d;
		  float u_xlat10_1;
		  float3 u_xlat16_2;
		  float4 u_xlat10_2;
		  float4 u_xlat16_3;
		  float4 u_xlat10_3;
		  float3 u_xlat16_4;
		  float3 u_xlat16_5;
		  float2 u_xlat16_6;
		  float3 u_xlat16_7;
		  float2 u_xlat16_14;
		  float2 u_xlat15;
		  float u_xlat10_15;
		  float u_xlat16_18;
		  float u_xlat16_20;
		  float u_xlat16_21;
		  float u_xlat16_25;
		  float u_xlat16_26;
		  OUT_Data_Frag frag(v2f in_f)
		  {
			  OUT_Data_Frag out_f;
			  u_xlat16_0 = (abs(PositionHole1.y) + abs(PositionHole1.x));
			  u_xlat16_0 = (u_xlat16_0 * 100);
			  u_xlat16_0 = min(u_xlat16_0, 1);
			  u_xlat1_d.xy = float2(max(float2(_WidthMainTex, _HeightMainTex), float2(4, 4)));
			  u_xlat15.xy = (float2(_WidthBloodTex, _HeightBloodTex) / u_xlat1_d.xy);
			  u_xlat1_d.xy = (float2(_WidthHoleTex, _HeightHoleTex) / u_xlat1_d.xy);
			  u_xlat16_7.xy = (((-u_xlat15.xy) * float2(0.5, 0.5)) + PositionHole1.xy);
			  u_xlat16_7.xy = ((-u_xlat16_7.xy) + in_f.texcoord.xy);
			  u_xlat16_7.xy = (u_xlat16_7.xy / u_xlat15.xy);
			  u_xlat16_2.xy = (u_xlat16_7.xy * float2(100, 100));
			  u_xlat16_2.xy = clamp(u_xlat16_2.xy, 0, 1);
			  u_xlat16_21 = (u_xlat16_0 * u_xlat16_2.x);
			  u_xlat16_2.xz = ((-u_xlat16_7.xy) + float2(1, 1));
			  u_xlat10_3 = tex2D(_BloodTex, u_xlat16_7.xy);
			  u_xlat16_7.xy = (u_xlat16_2.xz * float2(100, 100));
			  u_xlat16_7.xy = clamp(u_xlat16_7.xy, 0, 1);
			  u_xlat16_7.x = (u_xlat16_7.x * u_xlat16_21);
			  u_xlat16_7.x = (u_xlat16_2.y * u_xlat16_7.x);
			  u_xlat16_7.x = (u_xlat16_7.y * u_xlat16_7.x);
			  u_xlat16_7.x = (u_xlat16_7.x * u_xlat10_3.w);
			  u_xlat10_2 = tex2D(_MainTex, in_f.texcoord.xy);
			  u_xlat16_4.xyz = ((-u_xlat10_2.xyz) + u_xlat10_3.xyz);
			  u_xlat16_7.xyz = ((u_xlat16_4.xyz * u_xlat16_7.xxx) + u_xlat10_2.xyz);
			  u_xlat16_7.xyz = (u_xlat16_7.xyz * float3(100, 100, 100));
			  u_xlat16_7.xyz = floor(u_xlat16_7.xyz);
			  u_xlat16_4.xy = (((-u_xlat15.xy) * float2(0.5, 0.5)) + PositionHole2.xy);
			  u_xlat16_4.xy = ((-u_xlat16_4.xy) + in_f.texcoord.xy);
			  u_xlat16_4.xy = (u_xlat16_4.xy / u_xlat15.xy);
			  u_xlat10_3 = tex2D(_BloodTex, u_xlat16_4.xy);
			  u_xlat16_5.xyz = (((-u_xlat16_7.xyz) * float3(0.00999999978, 0.00999999978, 0.00999999978)) + u_xlat10_3.xyz);
			  u_xlat16_7.xyz = (u_xlat16_7.xyz * float3(0.00999999978, 0.00999999978, 0.00999999978));
			  u_xlat16_18 = (abs(PositionHole2.y) + abs(PositionHole2.x));
			  u_xlat16_18 = (u_xlat16_18 * 100);
			  u_xlat16_18 = min(u_xlat16_18, 1);
			  u_xlat16_6.xy = (u_xlat16_4.xy * float2(100, 100));
			  u_xlat16_6.xy = clamp(u_xlat16_6.xy, 0, 1);
			  u_xlat16_4.xy = ((-u_xlat16_4.xy) + float2(1, 1));
			  u_xlat16_4.xy = (u_xlat16_4.xy * float2(100, 100));
			  u_xlat16_4.xy = clamp(u_xlat16_4.xy, 0, 1);
			  u_xlat16_25 = (u_xlat16_18 * u_xlat16_6.x);
			  u_xlat16_4.x = (u_xlat16_4.x * u_xlat16_25);
			  u_xlat16_4.x = (u_xlat16_6.y * u_xlat16_4.x);
			  u_xlat16_4.x = (u_xlat16_4.y * u_xlat16_4.x);
			  u_xlat16_4.x = (u_xlat10_3.w * u_xlat16_4.x);
			  u_xlat16_7.xyz = ((u_xlat16_5.xyz * u_xlat16_4.xxx) + u_xlat16_7.xyz);
			  u_xlat16_7.xyz = (u_xlat16_7.xyz * float3(100, 100, 100));
			  u_xlat16_7.xyz = floor(u_xlat16_7.xyz);
			  u_xlat16_4.xy = (((-u_xlat15.xy) * float2(0.5, 0.5)) + PositionHole3.xy);
			  u_xlat16_4.xy = ((-u_xlat16_4.xy) + in_f.texcoord.xy);
			  u_xlat16_4.xy = (u_xlat16_4.xy / u_xlat15.xy);
			  u_xlat10_3 = tex2D(_BloodTex, u_xlat16_4.xy);
			  u_xlat16_5.xyz = (((-u_xlat16_7.xyz) * float3(0.00999999978, 0.00999999978, 0.00999999978)) + u_xlat10_3.xyz);
			  u_xlat16_7.xyz = (u_xlat16_7.xyz * float3(0.00999999978, 0.00999999978, 0.00999999978));
			  u_xlat16_25 = (abs(PositionHole3.y) + abs(PositionHole3.x));
			  u_xlat16_25 = (u_xlat16_25 * 100);
			  u_xlat16_25 = min(u_xlat16_25, 1);
			  u_xlat16_6.xy = (u_xlat16_4.xy * float2(100, 100));
			  u_xlat16_6.xy = clamp(u_xlat16_6.xy, 0, 1);
			  u_xlat16_4.xy = ((-u_xlat16_4.xy) + float2(1, 1));
			  u_xlat16_4.xy = (u_xlat16_4.xy * float2(100, 100));
			  u_xlat16_4.xy = clamp(u_xlat16_4.xy, 0, 1);
			  u_xlat16_26 = (u_xlat16_25 * u_xlat16_6.x);
			  u_xlat16_4.x = (u_xlat16_4.x * u_xlat16_26);
			  u_xlat16_4.x = (u_xlat16_6.y * u_xlat16_4.x);
			  u_xlat16_4.x = (u_xlat16_4.y * u_xlat16_4.x);
			  u_xlat16_4.x = (u_xlat10_3.w * u_xlat16_4.x);
			  u_xlat16_7.xyz = ((u_xlat16_5.xyz * u_xlat16_4.xxx) + u_xlat16_7.xyz);
			  u_xlat16_7.xyz = (u_xlat16_7.xyz * float3(100, 100, 100));
			  u_xlat16_7.xyz = floor(u_xlat16_7.xyz);
			  u_xlat16_5.xyz = (u_xlat16_7.xyz * float3(0.00999999978, 0.00999999978, 0.00999999978));
			  u_xlat16_4.xy = (((-u_xlat15.xy) * float2(0.5, 0.5)) + PositionHole4.xy);
			  u_xlat16_4.xy = ((-u_xlat16_4.xy) + in_f.texcoord.xy);
			  u_xlat16_4.xy = (u_xlat16_4.xy / u_xlat15.xy);
			  u_xlat10_3 = tex2D(_BloodTex, u_xlat16_4.xy);
			  u_xlat16_7.xyz = (((-u_xlat16_7.xyz) * float3(0.00999999978, 0.00999999978, 0.00999999978)) + u_xlat10_3.xyz);
			  u_xlat16_26 = (abs(PositionHole4.y) + abs(PositionHole4.x));
			  u_xlat16_26 = (u_xlat16_26 * 100);
			  u_xlat16_26 = min(u_xlat16_26, 1);
			  u_xlat16_6.xy = (u_xlat16_4.xy * float2(100, 100));
			  u_xlat16_6.xy = clamp(u_xlat16_6.xy, 0, 1);
			  u_xlat16_4.xy = ((-u_xlat16_4.xy) + float2(1, 1));
			  u_xlat16_4.xy = (u_xlat16_4.xy * float2(100, 100));
			  u_xlat16_4.xy = clamp(u_xlat16_4.xy, 0, 1);
			  u_xlat16_6.x = (u_xlat16_26 * u_xlat16_6.x);
			  u_xlat16_4.x = (u_xlat16_4.x * u_xlat16_6.x);
			  u_xlat16_4.x = (u_xlat16_6.y * u_xlat16_4.x);
			  u_xlat16_4.x = (u_xlat16_4.y * u_xlat16_4.x);
			  u_xlat16_4.x = (u_xlat10_3.w * u_xlat16_4.x);
			  u_xlat16_7.xyz = ((u_xlat16_7.xyz * u_xlat16_4.xxx) + u_xlat16_5.xyz);
			  u_xlat16_7.xyz = (u_xlat16_7.xyz * float3(100, 100, 100));
			  u_xlat16_7.xyz = floor(u_xlat16_7.xyz);
			  u_xlat16_5.xyz = (u_xlat16_7.xyz * float3(0.00999999978, 0.00999999978, 0.00999999978));
			  u_xlat16_4.xy = (((-u_xlat15.xy) * float2(0.5, 0.5)) + PositionHole5.xy);
			  u_xlat16_4.xy = ((-u_xlat16_4.xy) + in_f.texcoord.xy);
			  u_xlat16_4.xy = (u_xlat16_4.xy / u_xlat15.xy);
			  u_xlat10_3 = tex2D(_BloodTex, u_xlat16_4.xy);
			  u_xlat16_7.xyz = (((-u_xlat16_7.xyz) * float3(0.00999999978, 0.00999999978, 0.00999999978)) + u_xlat10_3.xyz);
			  u_xlat16_6.xy = ((-u_xlat16_4.xy) + float2(1, 1));
			  u_xlat16_4.xy = (u_xlat16_4.xy * float2(100, 100));
			  u_xlat16_4.xy = clamp(u_xlat16_4.xy, 0, 1);
			  u_xlat16_6.xy = (u_xlat16_6.xy * float2(100, 100));
			  u_xlat16_6.xy = clamp(u_xlat16_6.xy, 0, 1);
			  u_xlat16_20 = (abs(PositionHole5.y) + abs(PositionHole5.x));
			  u_xlat16_20 = (u_xlat16_20 * 100);
			  u_xlat16_20 = min(u_xlat16_20, 1);
			  u_xlat16_4.x = (u_xlat16_4.x * u_xlat16_20);
			  u_xlat16_4.x = (u_xlat16_6.x * u_xlat16_4.x);
			  u_xlat16_4.x = (u_xlat16_4.y * u_xlat16_4.x);
			  u_xlat16_4.x = (u_xlat16_6.y * u_xlat16_4.x);
			  u_xlat16_4.x = (u_xlat10_3.w * u_xlat16_4.x);
			  u_xlat16_7.xyz = ((u_xlat16_7.xyz * u_xlat16_4.xxx) + u_xlat16_5.xyz);
			  u_xlat16_7.xyz = (u_xlat16_7.xyz * float3(100, 100, 100));
			  u_xlat16_7.xyz = floor(u_xlat16_7.xyz);
			  u_xlat16_3.xyz = (u_xlat16_7.xyz * float3(0.00999999978, 0.00999999978, 0.00999999978));
			  u_xlat16_7.xy = (((-u_xlat1_d.xy) * float2(0.5, 0.5)) + PositionHole1.xy);
			  u_xlat16_7.xy = ((-u_xlat16_7.xy) + in_f.texcoord.xy);
			  u_xlat16_7.xy = (u_xlat16_7.xy / u_xlat1_d.xy);
			  u_xlat16_4.xy = (u_xlat16_7.xy * float2(100, 100));
			  u_xlat16_4.xy = clamp(u_xlat16_4.xy, 0, 1);
			  u_xlat16_0 = (u_xlat16_0 * u_xlat16_4.x);
			  u_xlat16_5.xy = ((-u_xlat16_7.xy) + float2(1, 1));
			  u_xlat10_15 = tex2D(_HoleTex, u_xlat16_7.xy).x;
			  u_xlat16_7.x = ((u_xlat10_2.w * u_xlat10_15) + (-u_xlat10_2.w));
			  u_xlat16_14.xy = (u_xlat16_5.xy * float2(100, 100));
			  u_xlat16_14.xy = clamp(u_xlat16_14.xy, 0, 1);
			  u_xlat16_0 = (u_xlat16_14.x * u_xlat16_0);
			  u_xlat16_0 = (u_xlat16_4.y * u_xlat16_0);
			  u_xlat16_0 = (u_xlat16_14.y * u_xlat16_0);
			  u_xlat16_0 = ((u_xlat16_7.x * u_xlat16_0) + u_xlat10_2.w);
			  u_xlat16_0 = (u_xlat16_0 * 100);
			  u_xlat16_0 = floor(u_xlat16_0);
			  u_xlat16_0 = (u_xlat16_0 * 0.00999999978);
			  u_xlat16_7.xy = (((-u_xlat1_d.xy) * float2(0.5, 0.5)) + PositionHole2.xy);
			  u_xlat16_7.xy = ((-u_xlat16_7.xy) + in_f.texcoord.xy);
			  u_xlat16_7.xy = (u_xlat16_7.xy / u_xlat1_d.xy);
			  u_xlat10_15 = tex2D(_HoleTex, u_xlat16_7.xy).x;
			  u_xlat16_21 = ((u_xlat16_0 * u_xlat10_15) + (-u_xlat16_0));
			  u_xlat16_4.xy = (u_xlat16_7.xy * float2(100, 100));
			  u_xlat16_4.xy = clamp(u_xlat16_4.xy, 0, 1);
			  u_xlat16_7.xy = ((-u_xlat16_7.xy) + float2(1, 1));
			  u_xlat16_7.xy = (u_xlat16_7.xy * float2(100, 100));
			  u_xlat16_7.xy = clamp(u_xlat16_7.xy, 0, 1);
			  u_xlat16_4.x = (u_xlat16_4.x * u_xlat16_18);
			  u_xlat16_7.x = (u_xlat16_7.x * u_xlat16_4.x);
			  u_xlat16_7.x = (u_xlat16_4.y * u_xlat16_7.x);
			  u_xlat16_7.x = (u_xlat16_7.y * u_xlat16_7.x);
			  u_xlat16_0 = ((u_xlat16_21 * u_xlat16_7.x) + u_xlat16_0);
			  u_xlat16_0 = (u_xlat16_0 * 100);
			  u_xlat16_0 = floor(u_xlat16_0);
			  u_xlat16_0 = (u_xlat16_0 * 0.00999999978);
			  u_xlat16_7.xy = (((-u_xlat1_d.xy) * float2(0.5, 0.5)) + PositionHole3.xy);
			  u_xlat16_7.xy = ((-u_xlat16_7.xy) + in_f.texcoord.xy);
			  u_xlat16_7.xy = (u_xlat16_7.xy / u_xlat1_d.xy);
			  u_xlat10_15 = tex2D(_HoleTex, u_xlat16_7.xy).x;
			  u_xlat16_21 = ((u_xlat16_0 * u_xlat10_15) + (-u_xlat16_0));
			  u_xlat16_4.xy = (u_xlat16_7.xy * float2(100, 100));
			  u_xlat16_4.xy = clamp(u_xlat16_4.xy, 0, 1);
			  u_xlat16_7.xy = ((-u_xlat16_7.xy) + float2(1, 1));
			  u_xlat16_7.xy = (u_xlat16_7.xy * float2(100, 100));
			  u_xlat16_7.xy = clamp(u_xlat16_7.xy, 0, 1);
			  u_xlat16_4.x = (u_xlat16_4.x * u_xlat16_25);
			  u_xlat16_7.x = (u_xlat16_7.x * u_xlat16_4.x);
			  u_xlat16_7.x = (u_xlat16_4.y * u_xlat16_7.x);
			  u_xlat16_7.x = (u_xlat16_7.y * u_xlat16_7.x);
			  u_xlat16_0 = ((u_xlat16_21 * u_xlat16_7.x) + u_xlat16_0);
			  u_xlat16_0 = (u_xlat16_0 * 100);
			  u_xlat16_0 = floor(u_xlat16_0);
			  u_xlat16_0 = (u_xlat16_0 * 0.00999999978);
			  u_xlat16_7.xy = (((-u_xlat1_d.xy) * float2(0.5, 0.5)) + PositionHole4.xy);
			  u_xlat16_7.xy = ((-u_xlat16_7.xy) + in_f.texcoord.xy);
			  u_xlat16_7.xy = (u_xlat16_7.xy / u_xlat1_d.xy);
			  u_xlat10_15 = tex2D(_HoleTex, u_xlat16_7.xy).x;
			  u_xlat16_21 = ((u_xlat16_0 * u_xlat10_15) + (-u_xlat16_0));
			  u_xlat16_4.xy = (u_xlat16_7.xy * float2(100, 100));
			  u_xlat16_4.xy = clamp(u_xlat16_4.xy, 0, 1);
			  u_xlat16_7.xy = ((-u_xlat16_7.xy) + float2(1, 1));
			  u_xlat16_7.xy = (u_xlat16_7.xy * float2(100, 100));
			  u_xlat16_7.xy = clamp(u_xlat16_7.xy, 0, 1);
			  u_xlat16_4.x = (u_xlat16_4.x * u_xlat16_26);
			  u_xlat16_7.x = (u_xlat16_7.x * u_xlat16_4.x);
			  u_xlat16_7.x = (u_xlat16_4.y * u_xlat16_7.x);
			  u_xlat16_7.x = (u_xlat16_7.y * u_xlat16_7.x);
			  u_xlat16_0 = ((u_xlat16_21 * u_xlat16_7.x) + u_xlat16_0);
			  u_xlat16_0 = (u_xlat16_0 * 100);
			  u_xlat16_0 = floor(u_xlat16_0);
			  u_xlat16_0 = (u_xlat16_0 * 0.00999999978);
			  u_xlat16_7.xy = (((-u_xlat1_d.xy) * float2(0.5, 0.5)) + PositionHole5.xy);
			  u_xlat16_7.xy = ((-u_xlat16_7.xy) + in_f.texcoord.xy);
			  u_xlat16_7.xy = (u_xlat16_7.xy / u_xlat1_d.xy);
			  u_xlat10_1 = tex2D(_HoleTex, u_xlat16_7.xy).x;
			  u_xlat16_21 = ((u_xlat16_0 * u_xlat10_1) + (-u_xlat16_0));
			  u_xlat16_4.xy = (u_xlat16_7.xy * float2(100, 100));
			  u_xlat16_4.xy = clamp(u_xlat16_4.xy, 0, 1);
			  u_xlat16_7.xy = ((-u_xlat16_7.xy) + float2(1, 1));
			  u_xlat16_7.xy = (u_xlat16_7.xy * float2(100, 100));
			  u_xlat16_7.xy = clamp(u_xlat16_7.xy, 0, 1);
			  u_xlat16_4.x = (u_xlat16_4.x * u_xlat16_20);
			  u_xlat16_7.x = (u_xlat16_7.x * u_xlat16_4.x);
			  u_xlat16_7.x = (u_xlat16_4.y * u_xlat16_7.x);
			  u_xlat16_7.x = (u_xlat16_7.y * u_xlat16_7.x);
			  u_xlat16_0 = ((u_xlat16_21 * u_xlat16_7.x) + u_xlat16_0);
			  u_xlat16_0 = (u_xlat16_0 * 100);
			  u_xlat16_0 = floor(u_xlat16_0);
			  u_xlat16_3.w = (u_xlat16_0 * 0.00999999978);
			  out_f.color = (u_xlat16_3 * in_f.color);
			  return out_f;
		  }


		  ENDCG

		} // end phase
	  }
		  FallBack "Diffuse"
}
